import http from '@/http/index.ts'
import { ConveyorGearMotorQuery, ConveyorGearMotor } from './type'

// 获取减速电机列表（分页）
export const getConveyorGearMotorList = (params: ConveyorGearMotorQuery) => {
  return http.get('/api/conveyor-gear-motor/page', params)
}

// 获取减速电机详情
export const getConveyorGearMotorDetail = (id: number) => {
  return http.get(`/api/conveyor-gear-motor/${id}`)
}

// 新增减速电机
export const addConveyorGearMotor = (data: ConveyorGearMotor) => {
  return http.post('/api/conveyor-gear-motor', data)
}

// 更新减速电机
export const updateConveyorGearMotor = (data: ConveyorGearMotor) => {
  return http.put('/api/conveyor-gear-motor', data)
}

// 删除减速电机
export const deleteConveyorGearMotor = (id: number) => {
  return http.delete(`/api/conveyor-gear-motor/${id}`)
} 